Method of Switching Resolution, Computing Device, and Computer-Readable Storage Medium

ABSTRACT

A method of switching resolution is provided. The method includes: in playing audio and/or video using DASH, acquiring a media presentation description (MPD) file and obtaining resolution information through parsing the MPD file; during the playing of the audio and/or video, periodically determining a currently secure downloading speed according to a preset time interval and determining whether a resolution switching for the audio and/or video currently being played is required according to the secure downloading speed and the resolution information; and in accordance with a determination that the resolution switching is required, determining a switching time point according to an elapsed duration of a currently playing segment and a preset secure buffering duration and performing resolution switching at the switching time point.

CROSS REFERENCE TO RELATED APPLICATION

The present application is a continuation under 35 U.S.C. 111(a) of PCTInternational Application No. PCT/CN2019/128448, filed on Dec. 25, 2019,which claims priority to Chinese patent application No. 201910091813.9,filed on Jan. 30, 2019, the entire contents of which are herebyincorporated by reference in their entirety for all purposes.

TECHNICAL FIELD

The present application relates to audio and video playing, andparticularly to a method of switching resolution, a computing device,and a computer-readable storage medium.

BACKGROUND

To make audio and video play more smoothly, more and more video websiteshave begun to use Dynamic Adaptive Streaming over HTTP (DASH)technology, which is an adaptive bitrate streaming technology andenables high-quality streaming media to be delivered over the Internetthrough a traditional HTTP web server; DASH splits a streaming mediacontent into multiple segments, each segment contains a certain length(e.g., 10 seconds) of playable content, and each segment iscorresponding to multiple resolutions (e.g., 1080P, 720P, 480P, 360P),and a client can choose to download and play the segments with aspecified resolution according to current network conditions. Comparedwith traditional audio and video playing technologies, it is notrequired to reload a player when switching a resolution.

SUMMARY

One aspect of the present application provides a method, including:

in playing audio and/or video using Dynamic Adaptive Streaming over HTTP(DASH), acquiring a Media Presentation Description (MPD) file andobtaining resolution information through parsing the MPD file;

during the playing of the audio and/or video, periodically determining acurrently secure downloading speed according to a preset time intervaland determining whether a resolution switching for the audio and/orvideo currently being played is required according to the securedownloading speed and the resolution information; and

in accordance with a determination that the resolution switching isrequired, determining a switching time point according to an elapsedduration of a currently playing segment and a preset secure bufferingduration and performing resolution switching at the switching timepoint.

Another aspect of the present application provides a computing device,including: one or more processors; and one or more non-transitorycomputer-readable storage mediums containing instructions configured tocause the one or more processors to perform operations including:

in playing audio and/or video using Dynamic Adaptive Streaming over HTTP(DASH), acquiring a Media Presentation Description (MPD) file andobtaining resolution information through parsing the MPD file;

during the playing of the audio and/or video, periodically determining acurrently secure downloading speed according to a preset time intervaland determining whether a resolution switching for the audio and/orvideo currently being played is required according to the securedownloading speed and the resolution information; and

in accordance with a determination that the resolution switching isrequired, determining a switching time point according to an elapsedduration of a currently playing segment and a preset secure bufferingduration and performing resolution switching at the switching timepoint.

Another aspect of the present application provides a non-transitorycomputer-program product tangibly embodied in a machine-readablenon-transitory storage medium that includes instructions configured tocause one or more processors to:

in playing audio and/or video using Dynamic Adaptive Streaming over HTTP(DASH), acquire a Media Presentation Description (MPD) file and obtainresolution information through parsing the MPD file;

during the playing of the audio and/or video, periodically determine acurrently secure downloading speed according to a preset time intervaland determine whether a resolution switching for the audio and/or videocurrently being played is required according to the secure downloadingspeed and the resolution information; and

in accordance with a determination that the resolution switching isrequired, determine a switching time point according to an elapsedduration of a currently playing segment and a preset secure bufferingduration and perform resolution switching at the switching time point.

BRIEF DESCRIPTION OF THE DRAWINGS

Upon reading the detailed description of some embodiments below, variousother advantages and benefits will become apparent to those of ordinaryskill in the art. The drawings are only for the purpose of illustratingsome embodiments and are not to be considered as limiting the presentapplication. Moreover, the same reference numerals are used throughoutthe drawings to refer to the same parts. In the drawings:

FIG. 1 illustrates a flowchart of a method of switching resolutionaccording to some embodiments;

FIG. 2 illustrates a schematic diagram of a content structure of an MPDfile according to some embodiments;

FIG. 3 illustrates a schematic diagram of a program module of a deviceof switching resolution according to some embodiments; and

FIG. 4 illustrates a diagram of hardware architecture of a computingdevice according to some embodiments.

DETAILED DESCRIPTION

To make the embodiments and advantages of the present application morecomprehensible, the present application is described in further detailbelow with reference to embodiments and the accompanying drawings. Itshould be understood that the specific embodiments described herein aremerely used for explaining the present application, and are not intendedto limit the present application. All other embodiments obtained bythose skilled in the art based on the embodiments of the presentapplication without creative efforts shall fall within the protectionscope of the present application.

Inventors found that when using DASH, it is not intelligent enough toswitch the resolution according to a selection of a user; in addition,since the segments are required to be downloaded and buffered, in aprocess of resolution switching, there will be situations where acurrently playing segment has been played completely but a next segmenthas not been downloaded yet, causing a playing freeze and affectinguser's experience.

According to some embodiments, the method of switching resolutionprovided by the present application is described below with reference tothe accompanying drawings.

FIG. 1 illustrates a flowchart of a method of switching resolutionaccording to some embodiments, and the method is applied to a DASHclient. As shown in FIG. 1, the method may include the following steps:

Step S101, in playing audio and/or video using DASH, acquiring an MPDfile and obtaining resolution information through parsing the MPD file.

Specifically, the resolution information includes multiple usableresolutions and bandwidths corresponding to respective ones of themultiple resolutions.

Further, the MPD file is a media presentation description file of theaudio and/or video, which can be used to describe composition of theentire MPEG DASH (also known as DASH) code streaming, being equivalentto M3U8 (M3U8 is a kind of video format) file in the HTTP Live Streaming(HLS) protocol, the MPD file is an XML (Extensible Markup Language)Document (Document is a computer term, and each Hyper Text MarkupLanguage (HTML) document loaded into a browser is a Document object),content of the MPD file can be used to construct URLs (Uniform ResourceLocator) of HTTP GET requests (HTTP GET request is a way of HTTPrequest) for downloading.

As shown in FIG. 2, illustrating a schematic diagram of contentstructure of the MPD file in XML format, the MPD file in XML formatincludes multiple segment Period files; each of the Period files has acorresponding AdaptationSet file for application description; oneAdaptationSet file contains Representation files for resolutiondescriptions of different resolutions or streams, each of theRepresentation files is corresponding to a resolution, and each of theRepresentation files contains a bandwidth requirement for thecorresponding resolution; one Representation file contains a pluralityof segments, and each segment is corresponding to a video content oraudio content for a certain time length.

In the MPD file in XML format, streaming media content is placed into aPeriod segment; video data and audio data in the streaming media contentare separately stored into different AdaptationSet segments; videos oraudios of different resolutions are represented by differentRepresentation segments; and video attribute information or audioattribute information is included in one Representation segment.

Further, the obtaining resolution information through parsing the MPDfile includes:

obtaining usable resolutions and bandwidths corresponding to respectiveones of the resolutions though parsing the Representation file in theMPD file.

According to some embodiments, in practical applications, a resolutionlist can be obtained by parsing the MPD file, and the resolution listincludes index values, information of resolutions, information ofbandwidths corresponding to the resolutions, and information of URLs(Uniform Resource Locator) of the audio or video.

Step S102, during the playing of the audio and/or video, periodicallydetermining a currently secure downloading speed according to a presettime interval and determining whether a resolution switching for theaudio and/or video currently being played is required according to thesecure downloading speed and the resolution information.

Specifically, the periodically determining the currently securedownloading speed according to a preset time interval includes:

step A1, obtaining playing information of N segments before thecurrently playing segment; where N is a positive integer;

further, the playing information includes: a connection establishmentduration, a downloading duration, and a total downloading byte count;

the connection establishment duration is duration from the time when theDASH client sends a request to the HTTP server to the time when the DASHclient receives the response returned by the HTTP server;

the downloading duration is duration from the time when the DASH clientstarts downloading audio and/or video based on the received response tothe time when the downloading is ended; and

the total downloading byte count is total number of bytes consumed fordownloading the audio and/or video.

In some embodiments, whenever a segment is downloaded, the DASH clientwill obtain the total downloading byte count from file header of asegment file, count the connection establishment duration and thedownloading duration of the segment, and store total downloading bytecount, the connection establishment duration, and the downloadingduration of the segment for later use in calculating the securedownloading speed.

Step A2, calculating an actual downloading speed of each segment basedon the playing information of each segment, and calculating an averagedownloading speed according to actual downloading speeds of the Nsegments;

further, the calculating an actual downloading speed of each segmentbased on the playing information of each segment includes: the actualdownloading speed=(8×the total downloading byte count)/(the connectionestablishment duration+the downloading duration).

The calculating an average downloading speed according to actualdownloading speeds of the N segments includes:

the average downloading speed=(a first actual downloading speed+a secondactual downloading speed+ . . . + an N-th actual downloading speed)/N.

Step A3, multiplying the average downloading speed by a preset securefactor and a percentage to obtain the currently secure downloadingspeed.

Further, the percentage K is calculated according to a formula of:

K=(D−L)/D;

where D is a playing duration of one segment;

L is an average connection establishment duration calculated accordingto connection establishment durations of the N segments, and L<D.

The Step A3 includes:

the secure downloading speed=the average downloading speed×P×K;

where P is the secure factor; according to some embodiments, P is 0.8.

In some embodiments, since a connection establishment time and a networkjitter of obtaining segments are taken into account when calculating thesecure downloading speed, current network speed can be guaranteed tomeet a bandwidth requirement of the resolution after the resolutionswitching. Specifically, the influence of the average connectionestablishment duration during downloading the segment is considered whencalculating the secure downloading speed; since the duration fromsending the segment downloading request by the DASH client to the HTTPserver to finishing downloading the segment includes the connectionestablishment duration and the downloading duration, the total durationof downloading the segment is the sum of the connection establishmentduration and the downloading duration; since the total duration ofdownloading the segment cannot exceed the playing duration of thesegment, the maximum downloading duration of the segment is thedifference between the playing duration of the segment and theconnection establishment duration of the segment; therefore, thepercentage K indicates a proportion of the maximum downloading durationof the segment to the playing duration of the segment. In addition, insome embodiments, a network jitter is also taken into account whencalculating the secure downloading speed, and the current downloadingspeed is guaranteed to be sufficient to meet the bandwidth requirementsof certain resolutions by the secure factor P.

Further, the determining whether a resolution switching for the audioand/or video currently being played is required according to the securedownloading speed and the resolution information includes:

adjusting resolutions of subsequently playing segments to be just lessthan a resolution corresponding to the bandwidth of the securedownloading speed.

In practical applications, the calculated secure downloading speed canbe compared with the bandwidth requirements of each resolution in theresolution list to determine the maximum resolution that the currentsecure downloading speed can support. For example, the current securedownloading speed is 120 Mbps, and according to the resolutioninformation, the available resolutions include 1080P, 720P, 480P, 360P;the bandwidth requirement of 1080P is 150 Mbps, the bandwidthrequirement of 720P is 100 Mbps, the bandwidth requirement of 480P is 50Mbps, and the bandwidth requirement of 360P is 25 Mbps; since thecurrent secure downloading speed can meet the bandwidth requirement of720P, the resolution of the segments being played afterward is adjustedto 720P.

Further, before the step S102, the method further includes:

calculating the average connection establishment duration according toconnection establishment durations of the N segments before thecurrently playing segment;

determining whether the average connection establishment duration islarger than the playing duration of one segment;

if yes, adjusting the resolution of the audio and/or video to be playedlater to the minimum; and

if not, step S102 is executed.

If the average connection establishment duration is larger than theplaying duration of one segment, it means that the next segment cannotbe fully downloaded before the currently playing segment is playedcompletely, that is, the audio and/or video of the current resolutioncannot be played smoothly; in this situation, the DASH client willminimize the resolution of the audio and/or video currently beingplayed.

In some embodiments, whether to perform resolution switching isdetermined periodically according to a preset time interval (forexample, whether to perform resolution switching is determined every 500seconds); when the determination is performed, the average downloadingspeed is calculated according to actual downloading speed of the N (forexample, N is 10) segments closest to the currently playing segment, andthe secure downloading speed is calculated considering the connectionestablishment duration and the network jitter; and based on the securedownloading speed, the resolution of the audio and/or video played lateris adjusted to the resolution that is sufficiently supported by thesecure downloading speed.

Step S103: in accordance with a determination that the resolutionswitching is required, determining a switching time point according toan elapsed duration of a currently playing segment and a preset securebuffering duration and performing resolution switching at the switchingtime point.

Specifically, step S103 includes:

calculating the switching time point T according to a formula of:

$T = {{ceil}\left( \frac{C + Q}{D} \right)}$

where ceil( ) is a round up function;

C is the elapsed duration of the currently playing segment; and

Q is the secure buffering duration, and Q is equal to 1.5 times theplaying duration of one segment; and

the resolution switching is performed when playing a T-th segment behindthe currently playing segment.

For example, when the value of (C+Q)/D is 3.4, the value of T is 4;after the currently playing segment is completely played, and when thefourth segment is played, the resolution switching is performed.

In some embodiments, the method of switching resolution can periodicallydetermine whether a resolution switching is required according to acurrently secure downloading speed under a preset time interval, andautomatically perform resolution switching at calculated switching timepoints. Performing resolution switching at the switching time points canavoid the situations where the segment corresponding to currentresolution has been finished playing, but the segment corresponding tothe resolution after the resolution switching has not been downloadedyet, sufficient downloading time is ensured for the segments after theresolution switching through calculating the switching time point,thereby, seamless switching of audio and/or video is ensured, and aphenomenon of switching freeze will not occur.

According to some embodiments, a device of switching resolution isprovided, based on the method of switching resolution according to someembodiments. Specifically, FIG. 3 illustrates a schematic diagram of thedevice of switching resolution, the device of switching resolution isdivided into one or more program modules, and the one or more programmodules are stored in a storage medium and executed by one or moreprocessors to complete the present application. The program modulesreferred to in the application refer to a series of computer-readableinstruction segments capable of performing specific functions, thefollowing description will specifically introduce the functions of eachof the program modules according to some embodiments.

As shown in FIG. 3, the device of switching resolution applied to a DASHclient includes: a parsing module 301 for acquiring a media presentationdescription (MPD) file and obtaining resolution information throughparsing the MPD file, when audio and/or video is played using DASH.

Specifically, the resolution information includes: multiple usableresolutions and bandwidths corresponding to respective ones of themultiple resolutions.

Further, the parsing module 301 specifically for:

obtaining usable resolutions and bandwidths corresponding to respectiveones of the resolutions though parsing the Representation file in theMPD file.

As shown in FIG. 3, the device of switching resolution applied to a DASHclient includes:

a determining module 302 for, during the playing of the audio and/orvideo, periodically determining a currently secure downloading speedaccording to a preset time interval and determining whether a resolutionswitching for the audio and/or video currently being played is requiredaccording to the secure downloading speed and the resolutioninformation.

Specifically, the determining module 302 includes:

an obtaining unit for, obtaining playing information of N segmentsbefore the currently playing segment;

a calculating unit for, calculating an actual downloading speed of eachsegment based on the playing information of each segment, andcalculating an average downloading speed according to actual downloadingspeeds of the N segments;

a processing unit for, multiplying the average downloading speed by apreset secure factor and a percentage to obtain the currently securedownloading speed; and

a switching unit for, adjusting resolutions of subsequently playingsegments to be just less than a resolution corresponding to thebandwidth of the secure downloading speed.

Further, the playing information includes: a connection establishmentduration, a downloading duration, and a total downloading byte count.

The calculating unit is specifically used for:

calculating an actual downloading speed of each segment according to aformula of:

the actual downloading speed=(8×the total downloading byte count)/(theconnection establishment duration+the downloading duration);

calculating an average downloading speed of the N segments according toa formula of:

the average downloading speed=(a first actual downloading speed+a secondactual downloading speed+ . . . + an N-th actual downloading speed)/N.

Further, the processing unit is used for:

calculating the percentage K according to a formula of:

K=(D−L)/D;

where D is a playing duration of one segment;

L is an average connection establishment duration calculated accordingto connection establishment durations of the N segments;

calculating the secure downloading speed according to a formula of:

the secure downloading speed=the average downloading speed×P×K;

where P is the secure factor, according to some embodiments, P is 0.8.

As shown in FIG. 3, the device of switching resolution applied to a DASHclient includes:

a switching module 303 for, in accordance with a determination that theresolution switching is required, determining a switching time pointaccording to an elapsed duration of a currently playing segment and apreset secure buffering duration and performing resolution switching atthe switching time point.

Specifically, the switching module 303 is used for:

calculating the switching time point T according to a formula of:

$T = {{ceil}\left( \frac{C + Q}{D} \right)}$

where ceil( ) is a round up function;

C is the elapsed duration of the currently playing segment; and

Q is the secure buffering duration, and Q is equal to 1.5 times theplaying duration of one segment; and

the resolution switching is performed when playing a T-th segment behindthe currently playing segment.

According to some embodiments, a computing device is provided. In someembodiments, the computing device may include but not limited to atleast one of: a smartphone, a tablet computer, a notebook computer, adesktop computer, a rack server, a blade server, a tower server, or arack server (including a stand-alone server, or server clusterconsisting of multiple servers), and so on that can execute programs. Asshown in FIG. 4, the computing device 40 of the embodiment includes atleast, but not limited to: a memory 401 and a processor 402 that can becommunicatively connected to each other through a system bus. It shouldbe noted that FIG. 4 only shows the computing device 40 having thecomponents 401-402, but it should be understood that not all componentsshown are required to be implemented, and more or fewer components maybe implemented instead.

In some embodiments, the memory 401 (i.e., readable storage medium)includes a flash memory, a hard disk, a multimedia card, a card-typememory (such as SD or DX memory and so on), a random access memory(RAM), a static random access memory (SRAM), a read-only memory (ROM),an electrically erasable programmable read-only memory (EEPROM), aprogrammable read-only memory (PROM), magnetic memory, magnetic disks,optical disks and so on. In some embodiments, the memory 401 may be aninternal storage unit of the computing device 40, such as a hard disk ora memory of the computing device 40. In other embodiments, the memory401 may also be an external storage device of the computing device 40,such as a plug-in hard disk, a smart media card (SMC), and a SecureDigital (SD) card, a Flash Card and so on. Of course, the memory 401 mayalso include both the internal storage unit of the computing device 40and its external storage device. In some embodiments, the memory 401 isgenerally used to store an operating system and various types ofapplication software installed in the computing device 40, such asprogram codes of the device of switching resolution according to someembodiments described above. In addition, the memory 401 can also beused to temporarily store various types of data that have been output orwill be output.

The processor 402 may be a Central Processing Unit (CPU), a controller,a microcontroller, a microprocessor, or other data processing chips insome embodiments. The processor 402 is generally used to control theoverall operation of the computing device 40.

Specifically, in some embodiments, the processor 402 is configured toexecute a program of a method of switching resolution stored in theprocessor 402, and when the program of the method of switchingresolution is executed, the following steps are implemented:

in playing audio and/or video using DASH, acquiring a media presentationdescription (MPD) file and obtaining resolution information throughparsing the MPD file;

during the playing of the audio and/or video, periodically determining acurrently secure downloading speed according to a preset time intervaland determining whether a resolution switching for the audio and/orvideo currently being played is required according to the securedownloading speed and the resolution information; and

in accordance with a determination that the resolution switching isrequired, determining a switching time point according to an elapsedduration of a currently playing segment and a preset secure bufferingduration and performing resolution switching at the switching timepoint.

Some specific embodiments and process of the foregoing method steps canrefer to the corresponding embodiments described above, which are notrepeatedly described herein.

According to some embodiments, a non-transitory computer-readablestorage medium (volatile or nonvolatile) is provided. In someembodiments, the non-transitory computer-readable storage medium mayinclude but not limited to at least one of: a flash memory, a hard disk,a multimedia card, a card-type memory (for example, SD or DX memory andso on), a random access memory (RAM), a static random access memory(SRAM), a read-only memory (ROM), an electrically erasable programmableread-only memory (EEPROM), a programmable read-only memory (PROM), amagnetic memory, magnetic disks, optical disks, servers, App Store andso on, which stores computer-readable instructions that upon executionby a processor cause the processor to implement the following steps:

in playing audio and/or video using DASH, acquiring a media presentationdescription (MPD) file and obtaining resolution information throughparsing the MPD file;

during the playing of the audio and/or video, periodically determining acurrently secure downloading speed according to a preset time intervaland determining whether a resolution switching for the audio and/orvideo currently being played is required according to the securedownloading speed and the resolution information; and

in accordance with a determination that the resolution switching isrequired, determining a switching time point according to an elapsedduration of a currently playing segment and a preset secure bufferingduration and performing resolution switching at the switching timepoint.

Some specific embodiments and process of the foregoing method steps canrefer to the corresponding embodiments described above, which are notrepeatedly described herein.

The method and device of switching resolution, the computing device, andthe computer-readable storage medium provided by the present applicationcan periodically determine whether a resolution switching is requiredaccording to a currently secure downloading speed under a preset timeinterval, and automatically perform resolution switching at calculatedswitching time points; since the connection establishment time and thenetwork jitter of obtaining segments are taken into account whencalculating the secure downloading speed, current network speed can beguaranteed to meet a bandwidth requirement of the resolution after theresolution switching; in addition, performing resolution switching atthe switching time points can avoid the situations where the segmentcorresponding to the resolution after the resolution switching has notbeen downloaded yet, but the segment corresponding to current resolutionhas been finished playing, thereby, seamless switching of audio and/orvideo is ensured, and a phenomenon of switching freeze will not occur.

It should be noted that, in this article, the terms “including”,“comprising” or any other variants thereof are intended to covernon-exclusive inclusion, so that a process, method, article or deviceincluding a series of elements includes not only those elements, butalso includes other elements not explicitly listed, or elements inherentto such a process, method, article, or device. Without morerestrictions, an element limited by the sentence “including a . . . ”does not exclude that there are other identical elements in the process,method, article, or device that includes the element.

The above-mentioned serial numbers of the embodiments of the presentapplication are merely for description and do not represent thesuperiority or inferiority of the embodiments.

Through the description of the above embodiments, those skilled in theart can clearly understand that the methods in the above embodiments canbe implemented by means of software plus a necessary universal hardwareplatform, and of course, also by hardware, but in many cases, the formeris the better implementation.

The above are only some embodiments of the present application, and thusdo not limit the patent scope of the present application, any equivalentstructure or equivalent process transformation made by using thecontents of the specification and drawings of the present application,or directly or indirectly used in other related technical fields areboth included in the scope of patent protection of this application.

What is claimed is:
 1. A method, comprising: in playing audio and/or video using Dynamic Adaptive Streaming over HTTP (DASH), acquiring a Media Presentation Description (MPD) file and obtaining resolution information through parsing the MPD file; during the playing of the audio and/or video, periodically determining a currently secure downloading speed according to a preset time interval and determining whether a resolution switching for the audio and/or video currently being played is required according to the secure downloading speed and the resolution information; and in accordance with a determination that the resolution switching is required, determining a switching time point according to an elapsed duration of a currently playing segment and a preset secure buffering duration and performing resolution switching at the switching time point.
 2. The method of claim 1, wherein the resolution information comprises: multiple usable resolutions and bandwidths corresponding to respective ones of the multiple resolutions.
 3. The method of claim 1, wherein the periodically determining a currently secure downloading speed comprises: obtaining playing information of N segments before the currently playing segment; calculating an actual downloading speed of each segment based on the playing information of each segment, and calculating an average downloading speed according to actual downloading speeds of the N segments; and multiplying the average downloading speed by a preset secure factor and a percentage to obtain the currently secure downloading speed.
 4. The method of claim 3, wherein the playing information comprises: a connection establishment duration, a downloading duration, and a total downloading byte count, and wherein the calculating an actual downloading speed of each segment comprises: the actual downloading speed=(8×the total downloading byte count)/(the connection establishment duration+the downloading duration).
 5. The method of claim 3, wherein the secure factor is 0.8, and wherein the percentage K is calculated according to a formula of: K=(D−L)/D; wherein D is a playing duration of one segment; and L is an average connection establishment duration calculated according to connection establishment durations of the N segments.
 6. The method of claim 2, wherein the determining whether a resolution switching for the audio and/or video currently being played is required comprises: adjusting resolutions of subsequently playing segments to be just less than a resolution corresponding to the bandwidth of the secure downloading speed.
 7. The method of claim 1, wherein the determining a switching time point and the performing resolution switching at the switching time point comprises: calculating the switching time point T according to a formula of: $T = {{ceil}\left( \frac{C + Q}{D} \right)}$ wherein ceil( ) is a round up function; C is the elapsed duration of the currently playing segment; and Q is the secure buffering duration, and Q is equal to 1.5 times the playing duration of one segment, and wherein the resolution switching is performed when playing a T-th segment behind the currently playing segment.
 8. The method of claim 5, further comprising: determining whether the average connection establishment duration is larger than the playing duration of one segment; in accordance with a determination that the average connection establishment duration is larger than the playing duration of one segment, adjusting the resolution of the audio and/or video to be played later to the minimum.
 9. A computing device, comprising: one or more processors; and one or more non-transitory computer-readable storage mediums containing instructions configured to cause the one or more processors to perform operations comprising: in playing audio and/or video using Dynamic Adaptive Streaming over HTTP (DASH), acquiring a Media Presentation Description (MPD) file and obtaining resolution information through parsing the MPD file; during the playing of the audio and/or video, periodically determining a currently secure downloading speed according to a preset time interval and determining whether a resolution switching for the audio and/or video currently being played is required according to the secure downloading speed and the resolution information; and in accordance with a determination that the resolution switching is required, determining a switching time point according to an elapsed duration of a currently playing segment and a preset secure buffering duration and performing resolution switching at the switching time point.
 10. The computing device of claim 9, wherein the resolution information comprises: multiple usable resolutions and bandwidths corresponding to respective ones of the multiple resolutions.
 11. The computing device of claim 9, wherein the periodically determining a currently secure downloading speed comprises: obtaining playing information of N segments before the currently playing segment; calculating an actual downloading speed of each segment based on the playing information of each segment, and calculating an average downloading speed according to actual downloading speeds of the N segments; and multiplying the average downloading speed by a preset secure factor and a percentage to obtain the currently secure downloading speed.
 12. The computing device of claim 11, wherein the playing information comprises: a connection establishment duration, a downloading duration, and a total downloading byte count, and wherein the calculating an actual downloading speed of each segment comprises: the actual downloading speed=(8×the total downloading byte count)/(the connection establishment duration+the downloading duration).
 13. The computing device of claim 11, wherein the secure factor is 0.8, and wherein the percentage K is calculated according to a formula of: K=(D−L)/D; wherein D is a playing duration of one segment; and L is an average connection establishment duration calculated according to connection establishment durations of the N segments.
 14. The computing device of claim 10, wherein the determining whether a resolution switching for the audio and/or video currently being played is required comprises: adjusting resolutions of subsequently playing segments to be just less than a resolution corresponding to the bandwidth of the secure downloading speed.
 15. The computing device of claim 9, wherein the determining a switching time point according to an elapsed duration of a currently playing segment and a preset secure buffering duration and performing resolution switching at the switching time point comprises: calculating the switching time point T according to a formula of: $T = {{ceil}\left( \frac{C + Q}{D} \right)}$ wherein ceil( ) is a round up function; C is the elapsed duration of the currently playing segment; and Q is the secure buffering duration, and Q is equal to 1.5 times the playing duration of one segment, and wherein the resolution switching is performed when playing a T-th segment behind the currently playing segment.
 16. A non-transitory computer-program product tangibly embodied in a machine-readable non-transitory storage medium that comprises instructions configured to cause one or more processors to: in playing audio and/or video using Dynamic Adaptive Streaming over HTTP (DASH), acquire a Media Presentation Description (MPD) file and obtain resolution information through parsing the MPD file; during the playing of the audio and/or video, periodically determine a currently secure downloading speed according to a preset time interval and determine whether a resolution switching for the audio and/or video currently being played is required according to the secure downloading speed and the resolution information; and in accordance with a determination that the resolution switching is required, determine a switching time point according to an elapsed duration of a currently playing segment and a preset secure buffering duration and perform resolution switching at the switching time point.
 17. The non-transitory computer-program product of claim 16, wherein the resolution information comprises: multiple usable resolutions and bandwidths corresponding to respective ones of the multiple resolutions.
 18. The non-transitory computer-program product of claim 16, wherein the periodically determining a currently secure downloading speed comprises: obtaining playing information of N segments before the currently playing segment; calculating an actual downloading speed of each segment based on the playing information of each segment, and calculating an average downloading speed according to actual downloading speeds of the N segments; and multiplying the average downloading speed by a preset secure factor and a percentage to obtain the currently secure downloading speed.
 19. The non-transitory computer-program product of claim 18, wherein the playing information comprises: a connection establishment duration, a downloading duration, and a total downloading byte count, and wherein the calculating an actual downloading speed of each segment comprises: the actual downloading speed=(8×the total downloading byte count)/(the connection establishment duration+the downloading duration).
 20. The non-transitory computer-program product of claim 17, wherein the determining whether a resolution switching for the audio and/or video currently being played is required comprises: adjusting resolutions of subsequently playing segments to be just less than a resolution corresponding to the bandwidth of the secure downloading speed. 